package java_exceptions;

public class Practice6 {
	static int divide(int x, int y) {
		int result;
		try {
			result = x / y;
		} catch (ArithmeticException cause) {
			throw new DivideByZeroException(cause);
		}
		return result;
	}
	public static void main(String[] args) {
		try {
			System.out.println(divide(10, 0));
		} catch (DivideByZeroException e) {
			System.out.println(e.toString());
			System.out.println("Cause : " +
			             e.getCause().toString());
		}
	}
}
